package edu.lingnan.lingnanblog.service;

import edu.lingnan.lingnanblog.entity.Blogger;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @author wuyuan
 * @since 2020-06-14 9:16
 */
@Component
@FeignClient(value = "LINGNANBLOG-PROVIDER-BLOGGER", fallbackFactory = BloggerClientServiceFallbackFactory.class)
public interface BloggerClientService {
    @GetMapping("blogger/selectOne/{id}")
    Blogger selectOne (@PathVariable("id") int id);

    @PostMapping("blogger/login")
    Blogger login(@RequestParam("name") String name, @RequestParam("password") String password);

    @PostMapping("blogger/reg")
    boolean reg(@SpringQueryMap Blogger bean);

    @GetMapping("blogger/getByName")
    Blogger getByName(@RequestParam("name") String name);

    @RequestMapping("blogger/save")
    boolean save(@SpringQueryMap Blogger blogger);


}
